AMX Mod X




Once a Patch, Now a Fork Aug 02, 2004 18:14
We have noticed that AMX Mod has, to everyone's surprise, updated. To help people decide which mod is a better choice, we have created a little chart comparing various features of AMX Mod X and AMX Mod.

In short, we're disappointed that AMX Mod has deceived the community for over a year and kept such a poor development process, but it's time for us to move on.


AMX Mod X vs. AMX Mod Comparsion Chart

EDIT: Before reading the posts in this thread, equip yourself with a flame preventing HEV suit.
.: by SniperBeamer 68 comments


Multi-Lingual System Jul 30, 2004 16:38
This writeup is intended to introduce users to how AMX Mod X 0.20's Multi-Lingual system works. If you are not a developer, you can probably disregard this.

I. Overview
II. Scripting
III. Modules
IV. Implementation

I. Overview

The AMX Mod X Multi-Lingual system is designed for optimized formatting of phrases to be delivered to clients. Each plugin and module is responsible for "reinforcing" a set of dictionary translations which can be used across many AMX Mod X functions. Each server sets a default language for translations to take place, and clients may set their own language as a setinfo ("_language").

AMX Mod X 0.20 will come with a plugin that allows users to select their language upon joining a server, if they do not already have one set. The Admin Menu will also let you choose the server's default language.
Language definitions are stored as formatted strings inside a "dictionary file". A dictionary file is a simple text file that looks like this (we'll call this one "greetings.txt"):
[en]
Hello = Hello, %s!
Bye = Goodbye, %s!
[es]
Hello = Hola, %s!
Bye = Adios, %s!
[de]
Hello = Guten Tag, %s!
Bye = Auf Wiedersehen, %s!


Three options are available for formatting - %s (String), %d (integer number), %f (float/decimal number). Dictionary files are loaded by plugins and cached by the AMX Mod X core.

II. Scripting
Dictionary Text Files are "reinforcements" for the master dictionary - which is an optimized binary file stored in the data folder. A plugin should make sure their definitions are already registered in the master dictionary with "register_dictionary", like so:
public plugin_init()
{
register_plugin("Language Test", "1.0", "BAILOPAN")
register_dictionary("greetings.txt")
}

For more information on how this works, see the Implementation section.
To format a message to a certain language phrase, there is a new descriptor available for all commands which accept the style of "format" (such as client_print, server_print, et cetera). The descriptor is L and is used like so:
format(buffer[], maxLength, "%L", clientID, languageKey[], [ ... ])

Here is an example:
public client_putinserver(id)
{
new name[24]
get_user_name(id, name, 24)
client_print(id, print_chat, "%L", id, "Hello", name)
}

Taking this step by step:
1. "%L" tells the string formatter to start a language translation. "%L" must always occur by itself like it is here.
2. "id" tells the language translation to use the language of the specific client "id". The client's setinfo _language is read, and if no language is found, the server's default is used (cvar amxx_language).
3. "Hello" tells the language translation to look up the definition for "Hello" (case insensitive). The definition from our dictionary is "Hello, %s" if the client is using English.
4. "name" tells the language translation to insert the client's name into the translation string as the first parameter (%s). This will result in "Hello, !".
5. The final formatted string is sent to the client. There are special exceptions to this rule. This will send a message to all clients in their own language:
client_print(0, print_chat, "%L", LANG_PLAYER, key[], [ ... ])

This will send a message to all clients in the server's language:
client_print(0, print_chat, "%L", LANG_SERVER, key[], [ ... ])

The special modifier -1 is only useable in functions that apply to
all users. Note that you cannot do something like:
//This is illegal, %L must appear alone.
client_cmd(0, print_chat, "echo %L", id, "Hello", name)


Also, as a side note, the "id" parameter can be the two letter code for a language, like "en" or "de", although most of the time this will be unnecessary.

Lastly, there are some commands you will most likely never need to
use. They are:
// Return the number of languages loaded
native get_langsnum();

// Return the name of a loaded language (0 to x-1)
// two letter code
native get_lang(id, name[3]);

//registers a dictionary file, making sure the words are in the dictionary
// the file should be in "addons/amxx/data/lang/", but only the name needs to be
// given. (e.g. register_dictionary("file.txt") will be addons/amxx/data/file.txt).
native register_dictionary(const filename[]);

//returns 1 if the language is loaded, 0 otherwise.
native lang_exists(const name[]);


III. Module Functions

The AMX Mod X MDK (Module Development Kit) has been updated with
two new functions:
void MF_MergeDefinitionFile(const char *file);
void MF_MergeDefinition(const char *language, const char *key, const char *definition);

Also, MF_FormatAmxString() can now accept the "%L" format listed above.

IV. Implementation
All dictionary results are cached in memory and on the disk in a binary file called "languages.dat", in addons/amxx/data or datadir. It's optimized for lookup by storing key pairs of hashes to offsets. More information will be available on this later.

Credits:
PM OnoTo, BAILOPAN, original concept by T(+)rget
.: by SniperBeamer 50 comments


64bit Compatibility Achieved! Jul 23, 2004 12:35
Yes, you read that right! AMX Mod X is now proudly the first 64bit Metamod plugin! (edit: that uses the Small engine - that's AM*) For 0.20 we will be distributing 64bit versions of AMX Mod X (and Metamod, if no official binaries exist by then).

To achieve this, we have built a new hybrid compiled called AMXXSC which compiles files into a new format called ABL (Abstract Ball). You can read more about this by clicking here.

The important thing is the physical changes you will see. AMX Mod X 0.20 plugins will be ".amxx" instead of ".amx" to differentiate between these two formats. This new format is for AMX Mod X only, however, old plugins will still work. I have prepared a simple chart to show what files will work, and where.

As you can see, the 64bit version of AMX Mod X can only use the new plugins. To help this transition the web compiler will use the new format and everyone will be urged to upgrade to AMX Mod X 0.20.

The AMD64 version is not heavily tested. If you would like to help test it, please PM BAILOPAN and we will get back to you as soon as possible. Although we have the JIT working on both Linux and Windows, we will not have an AMD64 Linux JIT in time for 0.20.

In other news, there will be a new compiler front-end for AMX Mod X 0.20! "compile.exe", to replace "compile.bat", will feature re-compilation intelligence and drag n' drop compiling!

For anyone crawling CVS for the new hybrid compiler source, we're not gonna commit it until right before the release date. The source to the 64bit changes to the Core have been committed however. You can read about the 32/64 hybrid compiler based off SC 2.5.1 by clicking here.

As usual, the mastermind behind the AMD64 port is PM OnoTo who took the time to sit down and debug all this. Thanks, PM!

That's not all! Look for updates to a Multi-Lingual AMX Mod X soon. As you can see, we've decided to make 0.20 a smashing release as possible.
.: by BAILOPAN 30 comments


Upcoming Release Jul 19, 2004 02:56
After four months of planning, programming, and publicizing, an official release date has been set for AMX Mod X 0.20! Here is the time line:
  • July 24th: AMX Mod X 0.20 will enter a "feature lock" for final stability testing. If you have any last feature requests, post them on www.amxmodx.org now.
  • August XXth *updated*, 18:00 GMT: There will be a public Question and Answer session on IRC for the upcoming release. Channel: #amxmodx @ irc.gamesurge.net (1PM EST, or 19:00 GMT+1).
  • August XXth, 21:00 GMT *updated*: AMX Mod X 0.20 packages will be released to the public. There will be a public IRC "release party" on #amxmodx @ irc.gamesurge.net (4PM EST, or 22:00 GMT+1).

This release is huge and breaks many old ties with the AMX Mod 0.9.6j source base. The entire module implementation has been redone from scratch as well as many core internal interfaces. We are announcing the release early to give the public a "head's up" on what is going to change and to alert developers to necessary plugin changes. As of 0.20, the AMX Mod X Core has greatly suprassed the original AMX core in functionality and efficiency.

On the release day the on-site compiler will be reset for 0.20 so any plugin that does not compile will not be downloadable. These notes are by no means the full changelog, these are the most important changes that you will be immediately affected by.

PACKAGING CHANGES

The most noticeable changes have to do with packaging. AMX Mod X 0.20 will be mod independent. There will be a "Base package" that contains the core files needed to run AMX Mod X on any mod. Then there will be separate mod "addon packs" which add special functionality for each mod, such as stats or weapon restriction.

The "custom" folder has been removed, and any plugins using it will need to be recompiled using the new includes and then its config files moved to the "configs" folder. Plugin writers should switch to using "get_configsdir" instead. Binary config files will now be stored in a "data" folder ("get_datadir").

If you would like to maintain a mod package (a mod package contains files from the AMX Mod X base that were changed to support your mod), please e-mail [email][email protected][/email]. Maintainers already exist for these mods: cs, dod, tfc, esf, ts, ns. WON packages will no longer be built.

CORE CHANGES

The biggest change is how AMX Mod X interfaces with Metamod and interacts with modules. Instead of attaching modules to Metamod and AMXx, the AMXx "FakeMeta" engine acts as a router between modules and Metamod. This removes many old problems including the infamous Listen Server crashes. For developers, AMX Mod X now features a complete MDK/SDK for easily and quickly building modules under a unified interface. Modules using the new interface will end in "amxx" instead of "amx".

The heart of the AMX Mod X core has been replaced with an implementation in pure assembly (a "Just in time" compiler). This should increase performance by enormous factors.

MODULE CHANGES

The second biggest change is the SQL driver. Completely rewritten from scratch, backwards compatibility was sacrificed in order to improve the databasing interface. All plugin developers should visit this forum post on the SQL changes and make sure their plugins compile under the new interface.
SQL Changes
Plugin authors should be ready to swap in new code when 0.20 is released.

The last biggest change is the introduction of a module which will eventually replace "Engine". Dubbed "FakeMeta" after its AMX Mod X core counterpart, it is a module forged from a number of sources and ideas and allows for nearly unlimited access to the Half-Life engine (hooking, calling, and changing any data). Plugin writers should study the power offered by FakeMeta once it is released and work to convert their plugins, as it will offer optimization in code, better looking source, and faster development time.

This about wraps it up. Please ask all questions in this news post to keep things organized. Plugin developers' questions get a higher priority. Remember, there will be a Q&A session three hours before the release in the official IRC channel.
.: by BAILOPAN 145 comments


Notice about Porting Plugins Jul 18, 2004 21:10
Devicenull has made us aware of this issue so I'm relaying it in a news post.

This is a general notice about porting plugins. Lately people have been taking old AMX plugins and simply changing the includes or even using already ported AMXx plugins.

This is a "no-no". If you are going to port someone's old plugin, you must be ready to take the responsibility of upkeeping it, making bug-fixes, and making sure it works. Otherwise porting it is pretty pointless and is just added clutter. This isn't to say "don't port", porting is very helpful, but only if it's done properly.

People who continually post ported or copied plugins and do not take responsibility will be SWOOPED and GRASPED from the plugin pool. Thanks for understanding.
.: by BAILOPAN 2 comments



1 ... 16 17 18 ... 26

© Copyright 2003-2025 AMX Mod X Dev Team