Server Help Forum Index Server Help
Community forums for Subgame, ASSS, and bots
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   StatisticsStatistics   RegisterRegister 
 ProfileProfile   Login to check your private messagesLogin to check your private messages   LoginLogin (SSL) 

Server Help | ASSS Wiki (0) | Shanky.com
ACE -- ASSS C Enricher (beta 2 released!)

 
Post new topic   Reply to topic Printable version
 View previous topic  <C> ball_motion Post :: Post Hosted Game Core  View next topic  
Author Message
Arnk Kilo Dylie
Seasoned Helper


Age:36
Gender:Gender:Male
Joined: Jul 14 2006
Posts: 108
Offline

PostPosted: Sat Jan 23, 2010 1:12 am    Post subject: ACE -- ASSS C Enricher (beta) Reply to topic Reply with quote

I'm a lazy guy, and this is a tool that I pieced together to enable my lazy tendencies. With any luck, it will be useful to you too.

ACE is a tool for building modules. Some of the most tedious things asss makes you do are automated by using a special middle language that has directives and expansion functions wrapped around your usual C functions.

After working on it on and off for a few months, I am making a beta release to get feedback and iron out any problems I couldn't find in my simple tests of everything (and any really embarrassing things like debug messages that break the output!)

The target audience for this tool is lazy programmers, or specifically anyone who is annoyed at some of the overhead in making well-behaved modules (gracefully failing, logging why load failed, registering/unregistering things, etc.)

Major functionality:
* Generate full asss modules (especially the entry point function) from a builder language that lets the user specify specific asss patterns.
* Wrap asss constructs including callbacks, interfaces, commands, and advisers by automatically registering and unregistering them in the correct order.
* Specify what interfaces your module needs to successfully load, and ACE will fully handle and log any failures to obtain the interfaces.
* Automatic handling of "dynamic" per-arena-data and per-player-data, allowing full structures to only be allocated when they apply.
* Automatically prototype functions.

It is designed to work with the asss makefile if you put it in the src/ace/ folder right now, with your input files using the .aces extension. You still have to put your modules in a .mk for so_files=blah like normal C modules.

Stand in awe at how a simple hello-world program is actually about as many lines as one should be in ACE, while the resulting C program is much bigger (even if you don't count the fourth-gear logging and error handling ACE adds):
Code: Show/Hide

$#module greeter

$#callback global CB_PLAYERACTION
void paction(Player *p, int action, Arena *a)
{
   if (action == PA_CONNECT)
      chat->SendMessage(p, "Greetings, human.");
}
$#endcallback

Code: Show/Hide

#include "asss.h"

local Imodman *mm;
local Ilogman *lm = 0;
local Ichat *chat = 0;

local void paction(Player *p, int action, Arena *a);


void paction(Player *p, int action, Arena *a)
{
        if (action == PA_CONNECT)
                chat->SendMessage(p, "Greetings, human.");
}

EXPORT int MM_greeter(int action, Imodman *_mm, Arena *arena)
{
        int failedLoad = FALSE;
        if (action == MM_LOAD)
        {

                mm = _mm;
                lm = mm->GetInterface(I_LOGMAN, ALLARENAS);
                if (!lm)
                        return MM_FAIL;
                chat = mm->GetInterface(I_CHAT, ALLARENAS);
                if (!chat)
                {
                        lm->Log(L_ERROR, "<greeter> error obtaining required interface I_CHAT " I_CHAT);
                        failedLoad = TRUE;
                        goto ace_fail_load;
                }

                mm->RegCallback(CB_PLAYERACTION, paction, ALLARENAS);

                return MM_OK;
        }
        else if (action == MM_UNLOAD)
        {

                mm->UnregCallback(CB_PLAYERACTION, paction, ALLARENAS);
ace_fail_load:

                mm->ReleaseInterface(lm);
                mm->ReleaseInterface(chat);
                if (failedLoad)
                        return MM_FAIL;
                else
                        return MM_OK;
        }
        return MM_FAIL;
}


I encourage all of you to try ACE and give feedback on the language and performance. Please document issues on the issue tracker, too.

Downloads
Home page - There's fairly complete documentation here, too.
Issue Tracker


Last edited by Arnk Kilo Dylie on Tue Apr 26, 2011 11:04 pm, edited 3 times in total
Back to top
View users profile Send private message Add User to Ignore List Visit posters website
Lynx
Newbie


Age:34
Gender:Gender:Male
Joined: Jan 26 2009
Posts: 19
Location: My mothers basement.
Offline

PostPosted: Sat Jan 23, 2010 8:12 am    Post subject: Reply to topic Reply with quote

Nice Job
Back to top
View users profile Send private message Add User to Ignore List Visit posters website AIM Address MSN Messenger
Cheese
Wow Cheese is so helpful!


Joined: Mar 18 2007
Posts: 1017
Offline

PostPosted: Mon Jan 25, 2010 12:02 am    Post subject: Reply to topic Reply with quote

im also lazy, therefore i dont feel like downloading anything extra
_________________
SSC Distension Owner
SSCU Trench Wars Developer
Back to top
View users profile Send private message Add User to Ignore List Visit posters website AIM Address
Arnk Kilo Dylie
Seasoned Helper


Age:36
Gender:Gender:Male
Joined: Jul 14 2006
Posts: 108
Offline

PostPosted: Tue Apr 26, 2011 11:04 pm    Post subject: Reply to topic Reply with quote

Update: Beta 2 was released. This version is much more polished, and more feature complete, and you are encouraged to try it out and find things it still lacks or that you still want.

SSCE Hockey/Football Zone and SSCE Hyperspace both use this tool to different degrees, and you are encouraged to as well.

Check the downloads links in the first post.
Back to top
View users profile Send private message Add User to Ignore List Visit posters website
Display posts from previous:   
Post new topic   Reply to topic    Server Help Forum Index -> ASSS Custom Projects All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum
View online users | View Statistics | View Ignored List


Software by php BB © php BB Group
Server Load: 656 page(s) served in previous 5 minutes.

phpBB Created this page in 0.502006 seconds : 30 queries executed (93.9%): GZIP compression disabled