Page 1 of 1

Age of Valor - SOURCE CODE RELEASE

Posted: Thu Nov 08, 2012 3:04 pm
by Red Squirrel
This is the entire package required to run Age of Valor, and it is released "AS IS" with no support or liabilities. You may use it as is if you wish or look at code to strip out certain custom features.

It is mostly released for those curious to see some of the changes we made over the years. I don't recommend to use this to start a shard, simply because there is newer stuff out there now. RunUO has made quite a lot of advancements since the shard was started and this is based off a very old version.

*** Link removed, no longer available ***
-------------------------------------------------------------------------------
Age of Valor Official Code Release - Nov 08 2012
http://www.uovalor.com
-------------------------------------------------------------------------------

About
-----

Age of Valor was a custom shard founded around December of 2006 and ran till June 2 2012. It was a great time and we've made lot of friends, but sadly things just started to die. We fought to keep it online, but realized it was just more of a chore to keep up with EA, fix existing code/systems and overall was not as fun anymore. With that, we decided it was in our best interest to close down the shard.

I debated for a long time about releasing the code. Not because I don't want people to have access to it, but because there are tons of loose ends and unfinished code, and even duplicated stuff. It’s a mess. While the majority of our code (on top of existing RunUO code)’ is written by Death and myself (Red Squirrel) some of it does come from pre made packages such as Malganis’ ML and we were merging it with our own code. When things started to fall behind we started looking at packages more to at least give us a kick start. One of our major slow downs was a 6 month project that turned into a 2+ year project: converting the save system to MySQL. There was several revisions of this system made from scratch, and while our final one is stable, it took longer than anticipated to get to that point. By then, we were very behind and even RunUO had most of ML done. Lot of people were quitting our shard for other shards that had more updates. Having to fight with EA constantly changing packets also made things difficult as we were in the middle of a core change and not able to release the core in it's state. Long story short, things got to a point where we could not do a small update until the big one was ready. Things slowed down and by the time we did release our big update, it was just too late.


Requirements
------------

As mentioned this shard uses MySQL as it’s storage back end. A dedicated MySql server or VM is recommended for best performance. I never tested MySQL in Windows, only Linux, but I imagine it would be fine in Windows. RunUO itself was only tested and ran on windows server 2003 and the dependencies in the core/dependencies folder. I recommend this configuration as it was never tested in server 2008.

Note that it can be difficult to get this to work, whenever I would deploy a new test/dev/live environment I always had to fight with all the M$ dependencies. Every time I would wing it and play around and eventually things would work. If you get an error about the path not being valid or something to that extent (it's a different shade of red than standard RunUO errors) then you need to copy the MySql.Data.dll file somewhere, where somewhere is different each time. Try c:windows, c:windowssystem32, c:program files .net folder and it's parent folders etc... Instead of going on a wild goose chase I would often just copy it everywhere I can think. Eventually it works. Blame Microsoft for making it this silly and inconsistent. I should have converted all this to C++ while I was ahead, would solve a lot of these issues.

This package was last tested on client 7.0.18.0 and chances are will not work without adding any packet changes EA has made since then. They have been very aggressive with this which is one of the things that kept holding us back as we were constantly having to fix and refix every time they updated. Speaking of clients, this shard was never designed to be backwards compatible with clients. This was by design. We much rather wanted people running the same version than having to support different old versions.


Notable features
----------------

Off the top of my head, these are some notable features one may want to look at stripping out for their own shard:

- Real time SQL save system. Every time any changes are made to the world, the object is put into a queue. This queue is processed at intervals of a few seconds and the new object is updated/written/deleted in the SQL database. At certain intervals (about a minute or so) a snapshot of the database is created. This is done at a time where the world is atomic (no pending changes). Should the server crash or be restarted, it will load from this snapshot. A restart forces an atomic save. (basically flushing the queue if any) When lot of changes occur at once, they start to queue. The queries are written in the same thread as the shard, to avoid access violations. The queries (in text) are executed in another thread. It is possible for things to backlog but it does not take long for it to catch up once things slow down again. During initial loading from the old file system, it would take about 15 minutes for the shard to be fully written to SQL. About 600k objects if I recall. When we originally released the update with the SQL engine, we were actually able to only have a downtime equivalent to a server restart/compile. It basically treated all the loaded objects as new, and then wrote them. Our next update included the SQL loader. I have to say this is one of our most successful updates we have ever done. Even EA has long periods of downtime for big updates.

(notable features continued)

- Fully custom peerless key system. This was coded with expandability in mind, and not just for ML. Could use a few modifications such as a "use in place" feature so the key is actually a non movable item in the game.

- "Duplicate" maps, useful for events, basically gives more land mass. This is simply done by adding new maps that use the OSI files. So it's like making another trammel but you can do it with Malas and so on.

- Custom event system. CTF and PVP tourney sub classes. System is expandable to add more types of events.

- Lot of custom bosses, some are pretty neat like Crystal elemental. This was part of a "demitel" boss system that was never really finished. It was basically a custom boss expansion pack, if you will. Demitel boss was going to be a very powerful and complex boss requiring lot of team work, and defeating the other bosses first for an item/key that brings you to the main boss.... you can be creative and do whatever if you want to use these or change them.

- Lot of small misc enhancements, such as a GM command to duplicate houses. Great when building large arenas or custom areas. Using houses means users do not need to download custom maps.


MUCH more small and big enhancements, and too many to remember/add here.

You can look in our patch forum to get an idea of changes made:
http://www.uovalor.com/forum/viewforum.php?f=26


Support
-------

This is provided "as is" with no support. I will try to help where I can, but because this is a rather vast package, we cannot possibly remember everything we did and it's possible some things don't work out like they did for us... Windows stuff is like that. For game mechanics/system related support, look at the code, that's my best suggestion.

This package is geared more towards advanced users who don't mind fiddling around, taking things apart etc. Lot of our code depends on changes to top classes such as Mobile, PlayerMobile, BaseCreature etc so even ripping something out for your own shard may require to be aware of some of the changes we made, and going over some code and changing stuff to fit your own shard.

RunUO has made lot of advancements since we started and I would not recommend to start a new shard with this code. While it is fairly stable as far as crashes go, it is not the most up to date representation of UO and a lot of things could be done better, there are too many loose ends, duplicate stuff, and it's just not polished.


Bugs
----

There's a few really weird bugs that surfaced near the end of the shard's life. The only one I can recall at the time of this writing is the fact that the [kill command only works when it wants. It's probably something very silly, perhaps even some test code somewhere I forgot to remove. There was a few other bugs which I can't recall.

With the SQL system there is also a bug where the whole system will lock up for a few seconds. My suspicion is that it's to do with the way the C# garbage collector works, and it just gets fragmented and needs to do a cleanup internally, and this cleanup is out of our control. If I recall, more ram makes the issue happen less often. We only had 2GB in our production environment, and 1GB in our test and dev.


------------

I think I covered the most important stuff. I hope this is useful to you in some way or the other.

- Red Squirrel, owner/developer
- Death, developer

http://www.uovalor.com
Official Age of Valor website. While the shard is dead, there are no plans to remove the forum or site so it may act as a good place to search for details on changes made and so on.
Archived topic from AOV, old topic ID:6470, old post ID:37894