This is a very big revision with regards to the previous ones.

Before I can jump into networking, I had to do a couple of BIG changes, but then while I'm at it, make other changes too.

* Get card movements to be "teleporting" rather than continuous movements. (Less network traffic)
* Creating windows for each zone.
* Moved the "hardcoded" player1 hand to the same interface and methods that player2's did.

Revision 99 sees several new features, and changes, so please report bugs as you find them.

Revision 99:
Fix : (WAY OLD bug, see ref 63) Up and down on the deckeditor now keeps selected item selected (though focus is still not done)
F : Desideboarding for soloplay
F : There is now a window for each zone (per player)
U : Power/Toughness (to/from) searching has been made more descriptive (labels added)
U : Moving cards are now not "continuous", but are done via a "transparent" block, that shows you where is legal spots
Fix : Attaching onto player 2's cards doesn't invert the movements(for singleplayer)
U : Table is bigger, though effectively only "wider", decks and SB and zones have moved wider
MU : Misc User Interface changes (column widths in SB, Opponent hand etc.)
U : Playing cards Facedown from a zone is now easier (and from the "public zones" (graveyard/RFG) it'll display which card is played facedown)
U : Random discards now says that it was random.
Fix : Clicking "New" in the deckeditor, names the deck Untitled, and will now save as when clicking save
U : Loading a deck for player1, should select player1's old deck by default, and player2, should select player2's by default.
Fix : While creating tokens, tab will now stop at the P/T too.
U : Attaching works differently now! Unattaching with multiple attachments doesn't work 100%
Fix : Attacking with attached cards works as intended at the moment
U : RMGZone is no longer private, and cards are "public", so textures are displayed
(cards that are removed from the game facedown, should be flipped, or played facedown)
Fix : Searching for Gold - Mono cards, filtered out the genuine gold cards

The first announcement of Daring Apprentice on the Lazarus home page, is the most read new product announcement. See here for the announcement (made quite a while back!).

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!

So that means only 2.33 months left to program the game into alpha testing for net play. (I've told some of the people who follow the game that I want to be able to have it playable by the end of 2008) Oooh... I am putting pressure on myself. But it's a good thing.

Anyway, at the moment, with the new compiler, DA for linux is not even getting to the main screen. So my first priority is to get that working again. Also on linux Lazarus default development widgetset is gtk2, which will give me a sexier interface than gtk1, but that might be the blame for the non-starting too.

On windows my SVN lazarus (I am going to continue to use lazarus SVN now, as well as glscene SVN) is not rebuilding yet. It is because the compiler is trying to recompile stuff where he only needs to look at the .ppu files. Anyway, so I have some groundwork to be done to actually get it working.

On my wishlist for the deckeditor is the same ol', same ol' mana curve. Hopefully making it look pretty with GLScene, and some cool stacked graphs etc. Anyway... another is to incorporate my Excel "combo" calculator.

For this however, I had to implement the Hyper Geometric Distribution in pascal... I read the wikipedia article... My statistics are a little bit rusty, and I was really struggling. However, I followed the external links, to nerdbucket. He has an implementation for C++ as well as one for Ruby. But what *really* interested me, was the exponent / ln mathematics.

This enabled me to create a decent implementation of Hyper Geometric Distribution for Pascal... and here it follows:

Function lnFactorial(N:Integer):Double;
var i : integer;
aValue : double;
begin
if N = 0 then begin result := 1; exit; end;
aValue := 0;
for i := 1 to N do
aValue := aValue + ln(i);
Result := aValue;
end;


function BinomialCoef(n,k:integer):double;
var aValue : double;
begin
aValue := exp(lnFactorial(n) - (lnFactorial(k) + lnFactorial(n-k)));
BinomialCoef:=aValue;
end;

Function HypGeomDist(RequiredHits, PopulationSize, Targets, Attempts:integer):double;
begin
Result :=
BinomialCoef
(Targets,RequiredHits)
*
BinomialCoef
(PopulationSize-Targets,Attempts - RequiredHits)
/
BinomialCoef
(PopulationSize,Attempts);
end;

Please consider the code as public domain.

For the next revision (still to come out - will release when 0.9.26 is done) searching on colors for the deck editor has been improved.

Previously if you selected "White, Green, Gold, Mono-colored", then the mono-colored would take preference above Gold, and you would only find Mono-White and Mono-Green cards. Now, mono-colored and gold work together. This means, searching for "White, Green, Gold, Mono-colored" will return Mono-White cards, Mono-Green cards, and gold cards that are ONLY green and white. Another change, sees that it also adds all Hybrid-White, and Hybrid-Green cards to it. It assumes that any hybrid card can cast that as a "mono" color. (PLEASE let me know if this is not true!)

So as for color searching in Daring Apprentice... the only thing that remains are for understanding split cards... (ie. finding Fire/Ice on a mono-blue, or mono-red search).

At the moment it understands it as a gold card with colors Blue and Red.

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.

Neoshroom (Ryan Davis) who was one of the original authors and maintainers of Apprentice has contacted me. He basically said that the project is neat, and he's glad I kept references to Apprentice.

I'll be hopefully getting some input from him here and there, and this really encourages me to keep at the networking until we have a version 1.0 on the table.


A screenshot of how the linux version looks. It's not as pretty, and apparently it doesn't work on a lot of PCs... but it's a start. Linux are definitely going to be supported, but I am not a guru, so bare with me.

I've created a Daring Apprentice page on facebook. Become a fan, and spread the word.

Well, this revision started actually as a bugfix for what the new P2 docking broke, but grew into some other changes too. Crossbuilder updated GLscene so that I can now output the card's names etc. to "canvas". This prompted quite a bit of work into the linux binary, which is now pretty much as playable as the windows one.

I do not know what is the requirements for the linux binary, but it's compiled as a GTK1 widgetset, so I assume you'll need that.

I also hung around quite a bit on #lazarus-ide@irc.freenode.net (IRC Channel) and found out how to launch a browser process in WinXP. So now windows users will be able to view the local help (or go to the website / helpsite) from the help menu. To be tested in Vista of course, and other versions of windows too.

Revision 95:
Fix : Messages should only report the cardname on a random discard, not the casting cost as well
Fix : When closing the application, the docked hand must be undocked first, to prevent a crash
M : About box now has an added tab
M : Camera changes will always wait 1 second before saving now (giving you smoother changes)
F : For linux: Card names and all other texts are now drawn too (does not use GLSpaceText)
F : For windows: Help files can now be opened from the help menu
M : New linux binary uploaded

For 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

For me, the most important is that the Quicksort works properly now. Thanks to the guys over at: http://sandbox.mc.edu/~bennet/cs404/doc/qsort_pas.html.

I do not believe that the source is copyrighted, but I am mailing him this moment to find out.

Revision 91:

F : You can now set the cards in play's fontsize (default is 7)
M : Updated the documentation
Fix : Shuffle from library right click was broken
Fix : Quicksort of the database works now
Fix : Attacking with a tapped creature does not tap it another 90 degrees anymore
Fix : The very last card is now found in the database.
M : Added a separate project file for linux

I have still to work on the network again, but I've now introduced a couple of new things:

  • SVN is rearranged. Now boasts a "data" part, to make it easier for developers to get the sources and the data (separately).
  • SVN also now features a "Binaries" folder, in which you'll find only the .exes and the (what I call) .linux executables.
  • Zooming can now be done (as is standard with most 3d applications, and even some 2d applications like excel) via Ctrl-MouseWheelUp and Down.
  • A new eventide patch is added (one that is a little less buggy).
  • The application will now create 2 text files. One is for debug information (debug.txt) and the other one is for playing output and logging. (Output.txt)
That's it. Again... I am hoping to get the networking part going, but development is pretty much at a halt at the moment (busy at work stuff).

If someone can figure out a better way of displaying card's names, I'll be SO glad to hear. I don't want to have the cadencer running the whole time, as well as the fact that it doesn't work on linux at all (and not on Windows at the moment).

I've thought about adding a sprite above the card (ala Quake3 when you pummel someone) but I fear that it will get smaller the further away you move the card, as well as get some anti-aliasing done onto it, so it won't be so legible.

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.

Basically the only change is that I implemented Attaching. And it works (the first card selected is the "base" card) - Please test multiple attachments (ie. 1 Creature with Jitte and Moldervine cloak), as well as nested attachments (1 Creature with Jitte, with Faith's fetters on Jitte) for me, as I am not much of a tester.

The story of how I figured it out is interesting:

I figured out how to do it while I was - as it often happens - trying to explain to someone else what I want to do, and trying to understand why it didn't work.

Initially when I implemented attaching... The card would lie very nicely next to his mate... but then, when I tap it, the attached card would also tap... Which is how many players play... but it is wrong. So what I had was "inherited everything" what I wanted was "Inherited position", but not roll, or pitch etc.

Or the way I explained it... I want to have two mouse wheels, able to turn independantly, connected with a pipe... not a mouse wheel, with one long spoke with another mousewheel attached to it.

So all I did effectively... was to create an imaginary box above the "main" card, and then when you move the main card, you instead move the box above it, and both the children cards (the main card, and the attachee) are then also move. You can at the moment move the child card independantly - which is the way I wanted it initially.

Revision 78:
Just uploaded the install files as well

Revision 77:
F : Attaching is implemented. But beware, the tapping doesn't work properly...
Fix : Converted Mana cost is fixed
Fix : Sorting bug was fixed (was always there, but databases were sorted already previously)
Update: Database updated up to Shadowmoore

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.

Newer Posts Home

Blogger Template by Blogcrowds.