Well... Not much happened in terms of development... but lots have been happening on the Magic front? Exile... and no more combat damage stacks?
Well, that's one of those things... we'll see how I go about exile, as it's only cosmetic, but it's nice being able to do cosmetic.
Anyway, so I am now trying to convert my code to git. Not just because, but also just because. I want to learn git, and DA is a good place to learn it on, and networking (with my starting over from scratch the whole time) would work really well with git.
I'm getting ready for some more coding, but I am hoping to get a wireless network adapter for my PC soon, and this will ease my network coding. I also now have a 2nd pc (laptop) to my disposal which also will make coding easier.
Unfortunately though July is a new financial year, and quite a lot of prep will have to go into my budget for work. Hopefully not too long after that, I'll be able to add some code to my brand new (now not existing) git repository.
Labels: Networking, Procrastination, Programming
Ok... So the last commit had some networking code in the release notes, but I have a feeling most of that will be lost. I have never truly felt comfortable with the solution I had, in terms of elegance and scalability, and network effeciency etc.
I asked myself, how can I get it right? Well, I decided I needed to look at as much of other people's network code as I can get. Unfortunately I've not found a great deal, but I did find Almindor's (the guy who wrote lnet, which I use for networking) Lentilwars code. This has some elegant solutions to some problems I wasn't sure how to get through. The other piece of code is called DataPacker - written by Theo Lustenberger, which will be able to compress the data I send (zip), and make it easy for me to incrementally "decipher" the messages that was sent.
So generally I have hope to get the networking fully going, but for now it's still far off. I'm trying to get at least 30m of programming in a day. Obviously some days it'll be more, and others will be less. But 30m of DA focus a day... (even if it's more research).
Labels: Networking, Programming
Unfortunately, revision 102 is not the big network release I'd hoped it would be. I'll talk more about networking after the revision 102 parts. (seperate post)
I fixed a bug that was reported on the Bugs part of the wiki (thanks for whoever added that), Also, while testing my next export for excel stats, I found that loading a deck didn't display in the titlebar, and also requested you to save, even though you didn't change anything. So those are fixed too.
I was playing around with Magic Set Editor, and found their statistics to be pretty cool. So I suggested that they maybe fork that part of the project to create more of their nice statistics. I was told no go. For me... the thing about stats is that it's not so easy to program graphs etc. and I already know an application which is pretty good at it... Excel. So I've created an excel spreadsheet which can handle the stats. And added a function in DA to export the stats to a little text file.
So now, via Excel, you can have Mana Curve + Type graphs, or Color + Type (the two I have in by default)... but it's Excel Pivots... just use the data available. You can analyse however you want. I added a column called "mana source" which looks for "add" and "to your mana pool" to check for mana sources. This might be crude, and could sometimes be wrong, but it's a start. Obviously this will not work so 100% if you're using a non-english database. --- Which is kind of a hole...
Revision 102:
C : Lots of "template" code
C : Split the NetSend and NetReceive codes
Fix : Delete from SB button now deletes from SB and does not add to SB (rev 100 fixed the code).
Fix : On deckopen, the filename is now displayed in the deckeditor.
Fix : Loading a file (in deckeditor) no longer makes it dirty. (doesn't prompt for save if you exit without changes)
F : Export tab delimited data to Excel for deck stats (note, it drops it to the folder where the .exe is installed)
F : Added DeckStats.xls to the installs to help with stats (I made it not use macros, for security)
Labels: Deck Editor, Feature, Networking, Revision
I was contacted today an admin of the people over at http://www.slightlymagic.net to create a forum for DA... Which can now be found at: http://www.slightlymagic.net/forum/viewforum.php?f=49
In addition he told me about this link: http://forums.mtgsalvation.com/showthread.php?t=56796
But for now I will not add DA there, because net play is not featured. Hopefully as I said in the slightlymagic forum... it'll be here "real soon".
Labels: Community, Networking, Promotion
Well, this post is all about how I am programming the networks, and hopefully, how I think I am being "smart". Hopefully it doesn't all backfire into my face.
First of all... the way that the server and the client will be "sending" messages will be very, very similar. Thus, if the messages what they send will be similar, so will the messages they receive. The BIG difference comes in how they respond once the message is received.
For instance. The Client will request "DrawCard","Library" (Because I want the commands to look similar I added Library... Library is actually "Implied" with "DrawCard".) Then the server will send a reply "DrawCard","Forest"... In this case the "implied" position (the hand) is not used. So the message sent was the same, but the server will respond differently than the client will...
So what I've done to help me code cleanly, and hopefully smartly, is I've used the Lazarus feature of "including" files. So my generic send code can be used (NetSend.inc) for both the server and the client... both have "command","parameter" sending, it's just that the client is saying "DrawCard","Library", whilst the server is saying "DrawCard","Forest"... but they both use the exact (letter for letter) same code.
Even the receiving (NetReceive.inc) code can be reused, up to the point where the *interpretation* of "DrawCard" needs to happen. That then is seperated into the server's code, and the Client's code.
It does mean though that I'll have some "dead" commands on both sides... like "RequestNewTable"... the Server won't be sending a table request back... It does something else. This is few and far between though, so hopefully not too many dead alleys in my code.
Looking forward to hopefully be able to do some connecting to tables, and talking away soon. (And after that... who knows? Drawing and playing cards!)
Labels: Networking, Programming
This is a revision has some fixes, shows some of the work on the networking, but also, includes a Conflux patch. Hopefully it works great, and everything is hunky-dorey!
Let me know if any bugs came out of this revision.
Revision 101:
F : Multiple users on one installation is supported now (different settings per user) - to be tested on linux
F : A pointer is added for multiplayer games (not visible in single player) to point at blockers etc.
Fix : You can now shift cards up and down when viewing a zone.
Fix : Searching for "Gold" and not "exclude unselected colors" will find all the gold cards
F : Added an application icon.
C : Send messages of the whole "hand" window, excl life actions.
M : Conflux is now included. PLEASE TEST, as I do not supply it. Let me know if there is funnies!
Labels: Networking, Revision, Search
I was on the #Lazarus-ide channel on the Freenode server the other day, talking about open source projects and so forth. Some of the other people commented that in terms of open source, it's usually not the "best" programmers that can pull off the marvels of open source, but the most dedicated.
With that I realised that the networking is probably not that hard, I should just start. So really good news is that I've been busy! Nothing that will affect the users much at the moment, but in time, everything will slot together nicely.
My strategy for tackling this task is to do all the "sending" code first, and then follow with the receiving code (which I think will be harder, but if the sending is finalized, the receiving should be much easier).
My progress so far:
* I've added building blocks for sending code (which will probably be reused in the server).
* I've implemented most of the sending of actions in the "hand"
Labels: Networking
I haven't done much, but I fired it all up again, and I'll be going through each procedure with my "network" hat on... changing important bits, and adding the "if soloplay then ... else ... NETWORK CODE!" :-)
Anyway, so I'll check when and where I can do some programming, and after 10 Feb I'll be able to go on with a lot more time than I have at the moment.
I'll be preparing the client first, and then write the connection and the server code... so there'll be new revisions with really almost nothing new.
Although I am working on the pointer that will be visible for both players... which should be added to the one of the next revisions. You'll probably not be able to use it, as for solo it's pretty useless.
So not *too* much longer hopefully. :-)
Labels: Networking
A guy in a french magic community gave me this in an email:
I testing your software since yesterday and I think I never come back to apprentice because your's is better.
That's really awesome feedback for a developer. Thank you! I truly appreciate your comments!
Well... My dream of finishing netplay by 1 Jan 2009 looks highly unlikely, as I have only a month... But I *AM* going to give it a decent amount of attention this holidays, and hopefully fairly soon in 2009 we'll be able to play the full game.
In terms of Magic I haven't played in ages, and the South African scene is somewhat dying, partly because of the world economy, and partly because of our local economy, and partly due to Hasbro/Wizards running it like a business (which I cannot point any fingers to, but the 3rd world countries feel the impact of your higher level choices!)
But I am committed to the software, and hopefully we'll soon have some tournaments!
Labels: Feedback, Networking
I hate to use this as my excuse, but it really is my main motivator (demotivator?) that I am not continuing at the moment...
Lazarus 0.9.26 is a week or two away, and I'll be getting it when it's hot to start developing Daring Apprentice 0.9.26... (or whatever I'll call the first "release").
I am fairly happy with the way the design of the network play is going now... except for the decks... at first I wanted the server to keep track of the decks, but now I think I'll only let the tournament server do that... You don't want the player in the 1-on-1 game to know your deck just because he's the server.
For the tournament server, you'll need to log in and select your deck from your own little profile thingy on the server. (Which you uploaded)
Although I still don't mind the idea that you can get the other guy's deck if you want it... But functionality must be very limited as it is probably a vulnerability.
Labels: Lazarus, Networking, Programming
Revision 92 - 94: Randomly discard the Top angle
0 comments Posted by Reenen on Wednesday, August 13, 2008For this revision, I've added a very cool feature - tilting the camera - and I enabled the docking of the player 2 hand (at the moment it is not optional). The draw card functionality etc. has now shifted a little in the user interface, so that the opponent hand and the player hand works the same way. I've added a screenshot:
In the background I've been working on my test application for networking code, and I made great progress last night. As soon as I have a prototype, I'll post more on it here. You can have a look at the concept here.
Revision 94:
UF : Player2's hand now docks. (This may change for network!)
F : Random Discard implemented
F : You can now change the angle of the camera as well
M : Found the textures readme again
Labels: Feature, Networking, Programming, Revision, Screenshot
Network play to me is really hard to program. I'll explain my design for now, and if anyone would like to comment, please do. I need help on this... even if just the implementation.
If I ever want to make money out of this... I'll need to have a really spiffy server going, and basically create a "single user" server (run one game on it) and a multi user server, that can organise a whole tournament, with timeouts, player assignments, breaks, reports on the "meta game" etc. I can envision truly huge amounts of work and beautiful things there... And then sell this... dunno if I'll sell the application itself... that just sucks, but maybe ask a fee per player per tournament... something like $0.01 per player per tournament, payable everytime it gets to $100.
A nyway... Back to the network program... Server driven it will have to be... You'll not be able to do anything (including moving a card) before "asking" the server first.
So you click to draw a card... the client (DA) "asks" the server can you draw a card. The server will then answer "Yes: Card ='Wrath of God'" or "No" or "No more cards, you lose". (Though the server won't do anything once you've lost... for a tournament both players will need to "sign" the result slip.)
The same for moving the card... and here's why... what if your opponent moved the card too? The server will then decide (first come first serve) to move the card. Admittedly though you'll only be able to move the card while you're the owner, but still, you'll be asking first, and then receiving the movement back, and only then will your card move.
For this to work, you'll need a "local" card which is basically a new card created as you start to move your current card, and then as you lift your mouse, it requests the server to move the card... if the opponent hasn't moved it, the card then jumps (on both players' screens) to the new place. Hopefully connection speed won't be an issue.
So what's next... well, I guess to create a test application of where you move click and move and object, (locally) which will then ask permission to move another object. 3 Objects total... (actually 5) 1+1 local, 1 server, 1+1 opponent. So 1 is a representation of the server position, and the other one is your "request" object. Maybe I can create a small two player game doing this excersize.
Labels: Networking
I realised now that I really need more than one blog... So this is for my Daring Apprentice programming (which coincidently hasn't been happening recently), whilst my other blog is for my own thoughts and things.
So back to DA. My problem is at the moment that I do not believe in the networking system that I am writing at the moment. So I'll be back to the drawing board, as well as writing a "demo" program to first see how I want to do it. Once that is done, it should be fairly easy to implement into DA.
That's news... I'll keep you posted.
Labels: Admin, Networking