Still alive :)

Anything else to do with MoM IME
User avatar
Implode
Site Admin
Posts: 433
Joined: Fri Feb 24, 2006 3:35 am
Location: Newfoundland, Canada
Contact:

Still alive :)

Post by Implode »

Hi all and thanks to everyone for your continued interest coming back here from the fact that there are still new posts :) I'm also glad I disabled new registrations so the place wasn't completely overrun with spam posts. Its been a while since I checked back here and I'm sorry for that.

Going back probably 2 years now, I had been doing alright with the Java port of the server code, but... as with a lot of programming, its only after you try something once that you realise where the pitfalls are and how it should have been done in the first place. Considering this was supposed to be a port to a nice clean codebase in a readibly available language with lots of people out there experienced in using it, I had 3 really major problems with it (ignore this bit for the non Java programmers!)
1) I had a massive overhead spending huge amounts of time defining data structures, and how those are either read/written from XML (in the case of the database) or read/written down network sockets (in the case of the client/server comms messages), instead of spending time writing actual useful code.
2) Multithreading is always a headache, I tried to solve this the same way I did in Delphi, by creating a list of sequential locks such that locks always had to be obtained in a strict order so you couldn't get thread deadlocks. I thought this would be useful and allow the server to be processing multiple messages at once, but after working with it for a while the reality was every kind of message was locking the same things so they would all process sequentially anyway, so it was a massive amount of work for no benefit... which goes back to (1) about wasting time on overheads and not writing useful code.
3) I went nuts on generics, because I hate typecasting, so I wanted the multiplayer engine for example to be able to do .getSessionDescription() and get a MoM session description back without having to typecast it from the general session description. At the offset that was a good idea, but by the time I had multiple classes linking to each other I had some type definitions that were 3 lines long with all the generics listed out, and it just turned into an overbearing nightmare trying to manage it.

So between being bogged down with the 3 of those, and finding other games to play, it just kind of ground to a halt. Without having a clear way to proceed I lost all desire to try to. Since then I've now got 2 years more experience with using Java at work, specifically around using web services. You can't use web services for client/server games because the initiations are always client->server, the server cannot push data out to clients which it simply has to be able to for games like MoM. I wanted to get all the best parts of web services (specially things like, that you can strongly type the message layer in XSD/WSDL files and using Maven and wsdl2java you can get then Java objects representing all your messages generated automatically without having to spend ages writing them, or coding how the serialisation works) but lose the one way push restriction. And finally figured out how I wanted this to all work:
a) Have a big XSD which defines the structure of all the network messages - then use an xsd2java tool to create all the objects from this automatically.
b) Use JAXB to handle all the serialising of those messages down the network connection.
c) Use xsd2java and JAXB to handle creating Java objects representing the database and reading the XML in.
d) Change the network layer to handle all messages for one session sequentially, eliminating nearly all of the multithreading issues.
e) Has the ability for games not to die if clients disconnect, and has saving and reloading games built it from the start.
f) Take the 0.9.3 Delphi MoM IME client and change it to talk down the network using the XML that my Java network layer now uses.

a, b and c together will eliminate 75% of the Java code I had to previously write by hand. I started playing about with this to see if what I wanted was possible, and once I got a+b actually working got rather excited over trying to do stuff on this again. So am doing so when I get some spare time. There's a lot to do, I don't have the network layer finished at the moment, let alone building any MoM code on top of it, so don't go expecting to see a new version appear suddenly. But did want to at least let everyone know I am starting to pick this up again :)
Ole' Swifty
Posts: 8
Joined: Fri May 15, 2009 5:25 pm

Re: Still alive :)

Post by Ole' Swifty »

Fantastic to hear it.

I am wondering how you are going about speed up the process. Would you be willing to have others help you or share the source code?

Other than that I hope to see more posts from you and others, even if they are just nonsense.

Thanks so much for your continued work and I hope that sometime before the world ends we get to see a multiplayer MoM experience!
User avatar
Lucern
Posts: 113
Joined: Sat Jun 02, 2007 9:13 am

Re: Still alive :)

Post by Lucern »

Hah, took me a few days to see it, but I'm elated.

The 4th of May was when I got my PhD in anthropology. That and a message that Implode is resuming - a fine day indeed.

Best of luck to you Implode. I am, and always have been, rooting for this project.
User avatar
Tino Didriksen
Site Admin
Posts: 47
Joined: Sun Aug 17, 2008 10:05 am
Location: Odense, Denmark
Contact:

Re: Still alive :)

Post by Tino Didriksen »

That is definitely good to hear...
aggelon
Posts: 71
Joined: Tue May 16, 2006 6:58 pm
Location: FRANCE
Contact:

Re: Still alive :)

Post by aggelon »

Happy to read you !!!

Aggelon, official Implode's french translator :wink:
User avatar
Implode
Site Admin
Posts: 433
Joined: Fri Feb 24, 2006 3:35 am
Location: Newfoundland, Canada
Contact:

Re: Still alive :)

Post by Implode »

Its going very well! My plan is along the lines of:

** (done) 1) Write comms layer based on XML messages and JAXB
(done) 2) Update all the XSD files that define the structure of the server file and the portion of it that gets sent to the client, so all the object definitions reference and inherit from each other correctly and JAXB can load the whole lot in one go.
** (done) 3) Update the editor to work with the new more complex XSDs.
(done) 4) Write all the comms messages that get sent between the client and server as XSDs.
5) Pick through the common (to both client+server) code and unit tests from my old attempted Java port to see what of it is still useful
6) Get the graphics XML file editor using the new XSD structure as well
** 7) Start the server code based on the new comms engine... which will mean picking through the server code from my old attempted Java port to see what of it is still useful
8 ) Get the old Delphi client code working + compiling again
9) Write Delphi comms component which communicates in XML
** 10) Start going through it message at a time implementing the server code for those messages + converting the Delphi client to 'talk' in XML

The ones marked with ** are the challenging parts :) But its going very well so far. 9+10 always worried me how I would get this to work, I figured I would find a way when I got that far but was worried it would be very complicated, but I have some good ideas for that now too :)

What I am struggling with is, having now not played the original MoM in ages, is I used to pretty well know in my head how all the game mechanics worked... so I knew how close my version was to it and what I was aiming for, and kind of knew all the things that didn't work yet (e.g. piles of unit skills and spells, transporting units, what types of combat). Right now all I'm really aiming for is getting something up and running again in whatever state it is in, but once it is, I'm grey on what to do next. I think the old list of what was planned to do in future versions is going to be out the window and need a big rethink about what needs to be gotten working first. But time to worry about that later once I have something runnable again.
User avatar
Lucern
Posts: 113
Joined: Sat Jun 02, 2007 9:13 am

Re: Still alive :)

Post by Lucern »

Wow, lots of stuff done last month. Can't say I understand much of it, but elated to hear that there's progress.

Edit: I hope you'll consider your forumites for technical MoM questions. Some of us know the game absurdly well.
Nehan
Posts: 32
Joined: Mon Jun 02, 2008 11:06 am

Re: Still alive :)

Post by Nehan »

Wow!
I honestly gave up all hope for this project, by a stroke of luck came here today, and huzzah!

Really great news Implode!


Nehan, official Implode's polish translator :wink:
Warsaw isn't a kind of a battle saw. It's the capital of Poland.
User avatar
Implode
Site Admin
Posts: 433
Joined: Fri Feb 24, 2006 3:35 am
Location: Newfoundland, Canada
Contact:

Re: Still alive :)

Post by Implode »

Implode wrote:5) Pick through the common (to both client+server) code and unit tests from my old attempted Java port to see what of it is still useful
Done! It took me a lot longer than I thought, because there was a lot more code there in the old Java port than I thought. On the downside that means it took me longer to get this done, on the plus side that means there's a lot more done at this stage than I was expecting... e.g. all the city calculations :)
Implode wrote:7) Start the server code based on the new comms engine... which will mean picking through the server code from my old attempted Java port to see what of it is still useful
Starting on this. There were some good bits of the attempted Java port I did before, in particular I had a really nice pluggable UI on the server so it would run either just a console app or run with status windows for each game running. So I'm trying to pull those bits out and stitch them to the new multiplayer engine. Quite a bit to sort out here, but I'm very happy that its moving along nicely and I'm not running into any major setbacks!
User avatar
Lucern
Posts: 113
Joined: Sat Jun 02, 2007 9:13 am

Re: Still alive :)

Post by Lucern »

W00t. Rock steady, Implode!
Coyote
Posts: 21
Joined: Mon Jun 26, 2006 11:09 pm
Location: Austin, TX

Re: Still alive :)

Post by Coyote »

He's ALIVE!!!!

Woot.
Nehan
Posts: 32
Joined: Mon Jun 02, 2008 11:06 am

Re: Still alive :)

Post by Nehan »

How are thing going, Implode?
Warsaw isn't a kind of a battle saw. It's the capital of Poland.
User avatar
Implode
Site Admin
Posts: 433
Joined: Fri Feb 24, 2006 3:35 am
Location: Newfoundland, Canada
Contact:

Re: Still alive :)

Post by Implode »

Been 2 weeks trying to get the map generator working, finished it last night but haven't managed to test it yet. Am trying to get as much as I possibly can done on the server side before I start trying to convert the client to talk to the server using XML. So its still going, just lot to do.
elliott20
Posts: 108
Joined: Tue Nov 21, 2006 8:56 pm

Re: Still alive :)

Post by elliott20 »

He's ALIVE!!!!

*holds parade*

Glad to see the project up and running again.
Lubricus
Posts: 49
Joined: Wed Oct 22, 2008 7:30 am

Re: Still alive :)

Post by Lubricus »

Wow! I had more or less given up hope on this project! Keep up the amazing work, Implode!
Post Reply