Page 1 of 2

Dominion Source Code (updated Jan 3rd, 2012)

PostPosted: 22 Mar 2010, 12:11
by jatill
My version was written using Visual Basic 6.

The source is freely available to use and modify, with the only condition being that you post any modifications (including the updated source) here, and keep my link to my other apps.

http://www.mediafire.com/file/c7iw043h3 ... n_code.zip

Re: Dominion Source Code

PostPosted: 22 Mar 2010, 14:05
by Bog Wraith
Backed up this file as well!

Re: Dominion Source Code (updated 4/1)

PostPosted: 12 Apr 2010, 20:56
by pinkymadigan
Out of curiosity, I tried to convert this up to .net (Express, 2008) and I receive an error regarding a missing key for Active-X controls. As I only really develop in .net (vb or C++ usually), I don't think I've ever run into this error before and a cursory google turned up inconclusive results. Any ideas? Or better yet, any chance you could convert the source up and post the converted source?

Re: Dominion Source Code (updated 4/1)

PostPosted: 13 Apr 2010, 11:57
by jatill
Is the .net software free, because I only have the old version. Is so, where do I find it?

Re: Dominion Source Code (updated 4/1)

PostPosted: 13 Apr 2010, 20:58
by pinkymadigan
Looks like 2010 was just released, guess I'll be getting an update at work soon. The "express" edition is free. It's pretty powerful, but lacks a lot of things that a professional dev team would want (source control support/multi-project solutions/ bunch-of-other-things-goes here).

http://www.microsoft.com/express/windows/

Re: Dominion Source Code (updated 4/1)

PostPosted: 23 Apr 2010, 07:52
by cteague3
Is it worth while creating a codeplex project out of this? It would be nice if we could do a team project for open development effort. I manage our TFS team project at work for our team development, and I understand that codeplex is supposed to allow the same type of team project continuous integration development, but I haven't tried it yet. I'm in the process of learning WPF applying MVVM pattern, along with the Prism pattern/practice. I've been coming up to speed with Expression Studio 3 at the same time. Is there any interest in attempting to do a version of your game in C# in this? I'm downloading VS2010 Ultimate, but can also grab the Express edition if necessary to be community friendly.

Re: Dominion Source Code (updated 4/1)

PostPosted: 23 Apr 2010, 08:01
by cteague3
Ok, just a quick follow-up. I logged into codeplex, and it appears to be pretty easy to create a project for team development. Here is the URL, but will require you to create an account first to login:
https://www.codeplex.com/site/project/create
What do you think? It says TFS based source control supports subversion clients, too, for what its worth...

Re: Dominion Source Code (updated 4/1)

PostPosted: 23 Apr 2010, 08:11
by cteague3
pinkymadigan wrote:Out of curiosity, I tried to convert this up to .net (Express, 2008) and I receive an error regarding a missing key for Active-X controls. As I only really develop in .net (vb or C++ usually), I don't think I've ever run into this error before and a cursory google turned up inconclusive results. Any ideas? Or better yet, any chance you could convert the source up and post the converted source?
I have a guess about this one. From what I understand with the Express editions (never used them myself), there is no interop support. ActiveX controls are COM based, so they are likely going to require interop. I wonder if we try to convert the code in VS2008 or VS2010 Pro or Ultimate, then figure out where the ActiveX references are, and hopefully find .NET replacements for the ActiveX code with .NET compatible versions, then go back into Express with the replacement code.

I haven't written any VB6 code in so long, I have forgotten what all may be referenced under the hood. The world is a mighty different place outside of the old VB Forms and even the .NET WinForms, now.

Re: Dominion Source Code (updated 4/1)

PostPosted: 23 Apr 2010, 13:10
by jatill
Personally I'm not interested in setting up a project, but if you want to take the initiative, I'm not going to object. I just uploaded my latest code version.

Re: Dominion Source Code (updated 4/23)

PostPosted: 25 Apr 2010, 03:45
by Nullgeek
I was also curious about converting this to .NET so I gave it a try. I also had an ActiveX exception but it was because I did not have VB6 installed. I installed VB6, got the project to run there and then converted. It went through just fine. There are some issues but nothing looks too difficult to fix to get to a starting point in .NET.

Uploaded the converted solution here: http://drop.io/Dominionvbnet

Enjoy!

Re: Dominion Source Code (updated 4/23)

PostPosted: 25 Apr 2010, 07:55
by cteague3
Awesome! I don't think I could have even found VB6 to install it... :-) MSDN doesn't have it available for download anymore. I'll take a look at it tomorrow sometime.

Re: Dominion Source Code (updated 4/23)

PostPosted: 26 Apr 2010, 11:44
by pinkymadigan
Thanks Nullgeek. I'm about 75% through getting it in working shape again with .net standards, and then I'll have to figure out why the transparent labels are showing through to the form's surface instead of the image, but it is definitely a good starting point.

@Jatill - I believe a large number of reported errors are due to the hard coded array limits. I usually find the game crashing with a large number of cards and I see the limit to any one pile appears to be 100. Not sure what other data types are available in vb6 but aren't there any list equivalents that could be dynamic (lists, queues, stl lists, etc)?

If not, you should at least create the upper limit to hold the worst case scenario - one opponent goes down to a deck of just an ambassador, (12 max actions cards * 14 max pile size) + all money + all curses + all point cards = max array size. Obviously unlikely to happen but you should always program for the corner cases. Note I didn't subtract any cards for last province, etc as this gives you a bit of wiggle room for things like implementing black market, where cards come from the ether.

Re: Dominion Source Code (updated 4/23)

PostPosted: 26 Apr 2010, 12:38
by jatill
Should I want until you're done with the conversion to change my code (I'm assuming you started with the 4/23 version?) Is .net free to use? Thanks!

Re: Dominion Source Code (updated 4/23)

PostPosted: 26 Apr 2010, 20:52
by pinkymadigan
.Net express is, and certainly has enough functionality to run the game. I don't know that anyone has any specific plans, but if someone wanted to set up a code repository I would definitely participate in a group project.

But I do not have any server space to host said project on myself.

As for waiting/updating, I don't think it would hurt to upkeep the vb6 version until a project gets it legs.

Re: Dominion Source Code (updated 4/23)

PostPosted: 16 May 2010, 01:56
by cteague3
I created a codeplex project, and uploaded both the VisualStudio 6 - VB6 code and the VisualStudio 2008 - VB.NET code. I haven't made any changes to either, from what you guys made available to download.

http://dominiondotnet.codeplex.com/

If you would like developer access to the project, drop me a note and I'll add you, or maybe you can request thru codeplex, not sure. Also, the project has to be "published" within 30 days, or it is automatically deleted. I don't know if "published" includes having binaries available for download or not. I would suspect not.

I would like to port this code. It will take me a bit to get a handle on the code as it is, but I'm C# proficient. I do not personally intend on touching either of the VS6-VB6 or VS2008-VB.NET code branches I just uploaded. I will start a VS2010-C#-.NET4 solution and use it for the port. I'm in the process of learning WPF & the MVVM design pattern, which I would like to take the opportunity for this port. I'll upload my progress shortly, and let you guys know about it.